{# based on http://svn.navi.cx/misc/trunk/djblets/djblets/datagrid/templates/datagrid/paginator.html #}

{% load paginator %}

{% if page_obj.has_other_pages %}
<div class="paginator">
 {% if show_first %}<a href="{% page_link link_type 1 extra_query %}" title="First Page">&laquo;</a></span>{% endif %}
 {% if page_obj.has_previous %}<a href="{% page_link link_type page_obj.previous_page_number extra_query %}" title="Previous Page">&lt;</a></span>{% endif %}
{% for pagenum in page_numbers %}
{%  ifequal pagenum page_obj.number %}
 <span class="current-page">{{pagenum}}</span>
{%  else %}
 <a href="{% page_link link_type pagenum extra_query %}" title="Page {{pagenum}}">{{pagenum}}</a>
{%  endifequal %}
{% endfor %}
{% if page_obj.has_next %}<a href="{% page_link link_type page_obj.next_page_number extra_query %}" title="Next Page">&gt;</a>{% endif %}
{% if show_last %}<a href="{% page_link link_type paginator.num_pages extra_query %}" title="Last Page">&raquo;</a>{% endif %}
 <span class="page-count">{{paginator.num_pages}} pages</span>
</div>
{% endif %}
